﻿using Pattern24解释器模式.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pattern24解释器模式.Models
{
    /// <summary>
    /// 终结符表达式
    /// </summary>
    public class TerminalExpression : Expression
    {
        private Expression direction, mode, distance;
        public TerminalExpression(Expression direction, Expression mode, Expression distance)
        {
            this.direction = direction;
            this.mode = mode;
            this.distance = distance;
        }

        public override string Interpret()
        {
            return string.Concat(direction.Interpret(),mode.Interpret(), distance.Interpret());
        }
    }
}
